{% extends "dashboard/base.html"%}

{% load machine_services %}
{% block content %}
    <div class="container-fluid">
        <table class="table table-bordered">
            <tr>
                <th>Hostname</th>
                <th>Status</th>
                <th>Services</th>
                <th>Load [5m, 15m, 1m]</th>
            </tr>
            {% for m in machines %}
                <tr>
                    <td><a href="machines/detail/?machine={{m.id}}" style="color: black;">{{m.hostname}}</a></td>
                    {% if m.status == "D" %}
                        <td><p class="label label-important">{{m.get_status_display}}</p></td>
                    {%endif%}
                    {% if m.status == "O" %}
                        <td><p class="label label-success">{{m.get_status_display}}</p></td>
                    {%endif%}
                    {% if m.status == "U" %}
                        <td><p class="label label-warning">{{m.get_status_display}}</p></td>
                    {% endif %}
                    <td>
                        {% show_services m %}
                    </td>
                    <td>
                        {% show_localhost m %}
                    </td>
                </tr>
            {%endfor%}
            <tr colspan="3">
                <center><p class="alert alert-info">Currently checking {{nmachines}} machines and {{nservices}} services.</p></center>
            </tr>
        </table>
    </div>
        
    
{%endblock%}

